package com.ytjj.qmyx.admin.service;

import com.ytjj.common.api.CommonPage;
import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.model.RegisterInsertRequest;
import com.ytjj.qmyx.admin.model.request.ReturnRegisterRequest;
import com.ytjj.qmyx.admin.model.response.ReturnRegisterResponse;
import com.ytjj.qmyx.mall.model.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 *
 *
 * @Version: 1.0
 */
public interface ReturnRegisterService {

    Integer insertReturnRegister(RegisterInsertRequest request);

    CommonPage<ReturnRegisterResponse> selectList(ReturnRegisterRequest returnRegisterRequest);

    Integer updateReturnRegister(ReturnRegisterRequest returnRegisterRequest);

    Integer delReturnRegister(Integer id);

    CommonResult refund(Integer id, String refundDesc, ReturnRegister register, OrdersInfo ordersInfo);

    Integer selectByOrderInfoId(Integer orderInfoId);

    void querySupplyChainOrderInfo(String childOrderNo,String serviceNo);

    void updateByEditReturnGoods(Integer ordersInfoId, Integer orderType, Integer reasonType, String reasonDetail);

    CommonResult handleRefundV4(Orders orders, OrdersRefund ordersRefund, OrdersInfo ordersInfo, OrdersPay ordersPay, ReturnRegister register, ReturnGoods returnGoods, String refundDesc);

    /**
     * 更新销售渠道的订单信息
     * @param orders
     * @param ordersRefund
     * @param ordersInfo
     * @param register
     * @param returnGoods
     * @return null
     */
    void updateAdminOrderInfo(Orders orders, OrdersRefund ordersRefund, OrdersInfo ordersInfo, ReturnRegister register, ReturnGoods returnGoods);

    /**
     * adapay执行退款
     */
    void doAdapayRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnRegister register,ReturnGoods returnGoods);

    /**
     * 首信易退款
     * @param orders
     * @param ordersRefund
     * @param ordersInfo
     * @param register
     * @param returnGoods
     */
    void upayRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnRegister register,ReturnGoods returnGoods);

    void hftxRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnRegister register,ReturnGoods returnGoods);

    void ZsyRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnRegister register,ReturnGoods returnGoods);

    void mhkjRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnRegister register,ReturnGoods returnGoods);

    /**
     * 支付宝执行一个退款
     * @param orders 主订单对象
     * @param ordersRefund 订单退款记录对象
     * @param ordersInfo 子订单对象
     * @param returnGoods 退货管理对象
     * @param refundDesc 退货描述
     * @return void
     */
    void doAliPayRefund(Orders orders,OrdersRefund ordersRefund,OrdersInfo ordersInfo,ReturnGoods returnGoods,String refundDesc,ReturnRegister register,OrdersPay ordersPay);

}
